package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.DeviceDataPageQueryDto;
import com.zzyl.entity.DeviceData;
import com.zzyl.service.DeviceDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "设备数据")
@RestController
@RequestMapping("/device-data")
public class DeviceDataController {

    @Autowired
    private DeviceDataService dataService;

    @ApiOperation("获取设备数据分页结果")
    @GetMapping("/get-page")
    public ResponseResult<PageResponse<DeviceData>> pageQuery(DeviceDataPageQueryDto dto){
        PageResponse<DeviceData> page =  dataService.pageQuery(dto);
        return ResponseResult.success(page);
    }
}